#include "kernel.h"

void pack_2_bytes(unsigned char *packet, unsigned int value) {
        packet[packet_len ++] = (value >> 8) & 0xff;
        packet[packet_len ++] = value & 0xff;
}

void pack_1_byte(unsigned char *packet, unsigned int value) {
        *(packet + packet_len ++) = value & 0xff;
}

void pack_4_bytes(unsigned char *packet, unsigned long value) {
        packet[packet_len ++] = (value >> 24) & 0xff;
        packet[packet_len ++] = (value >> 16) & 0xff;
        packet[packet_len ++] = (value >> 8) & 0xff;
        packet[packet_len ++] = (value) & 0xff;
}

